<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../412/lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2>{{title}}</h2>
        <h3 v-for="(l,i) in list" :key="i">{{l}}</h3>  <!--数组遍历-->
        <h3 v-for="(item,index) in arr" :key="index">{{item}}--{{index}}</h3>   <!--数组遍历-->
        <h3 v-for="(l,i) in items" :key="i">{{l.message}}</h3>   <!--数组对象-->
        <ul>
            <li v-for="(l,i) in provinces" :key="i">
                <h5>{{l.name}} -- {{i}}</h5>
                <ol>
                    <li v-for="(city,index) in l.cities" :key="index">
                        {{city.name}} -- {{index}}
                    </li>
                </ol>
            </li>
        </ul>
    </div>

    <script>
        var provinces = [{
            name: "浙江",
            cities: [{
                name: '金华',
            }, {
                name: '杭州'
            }, {
                name: '温州'
            }, ]
        }, {
            name: "湖北",
            cities: [{
                name: '武汉'
            }, {
                name: '襄樊'
            }, {
                name: '黄冈'
            }, ]
        }, {
            name: "江苏",
            cities: [{
                name: '南京'
            }, {
                name: '徐州'
            }, {
                name: '连云港'
            }, ]
        }];
        const vm = new Vue({
            data:{
                title:"v-for",
                arr:["Vue","React","Node","小程序"],
                list:["A","B","C","D","E","F","G","H","I","J"],
                items: [
                    { message: 'Foo' },
                    { message: 'Bar' }
                ],
                provinces,
            },
            methods:{},
            mounted(){
                document.getElementsByTagName('title')[0].innerHTML = this.title;
            }
        }).$mount("#app");
    </script>
</body>
</html>